package com.zzq.controller;


import com.aliyuncs.exceptions.ClientException;
import com.zzq.domain.search.AlbumSearchParamet;
import com.zzq.domain.search.PhotoSearchParamet;
import com.zzq.domain.search.ShootRecordSearchParament;
import com.zzq.result.SmileResult;
import com.zzq.service.ClientAlbumService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/client/album")
@RestController
@Api(value = "客户端相册控制接口",tags = {"客户端相册控制接口"})
public class ClientAlbumController {

    @Autowired
    ClientAlbumService clientAlbumService;


    @PostMapping("/list")
    @ApiOperation("相册列表")
    public SmileResult albumList(@RequestBody AlbumSearchParamet searchParamet){
        return clientAlbumService.getAlbumList(searchParamet);
    }
    @PostMapping("/loadedalbum")
    @ApiOperation("获取已解锁相册相片")
    public SmileResult getdownLoadAlbumListById(@RequestBody AlbumSearchParamet searchParamet) throws ClientException {
        return clientAlbumService.getdownLoadAlbumListById(searchParamet);
    }

    @PostMapping("/settleaccount")
    @ApiOperation("计算金额")
    public SmileResult settleAccounts(@RequestBody ShootRecordSearchParament photoSearchParamet){
       return clientAlbumService.settleAccounts(photoSearchParamet);
    }

    @PostMapping("/download")
    @ApiOperation("获取下载链接")
    public SmileResult downloda(@RequestBody PhotoSearchParamet photoSearchParamet) throws ClientException {
       return clientAlbumService.downLoad(photoSearchParamet);
    }

    /**
     * 更新支付结果
     * @param shootRecordSearchParament
     * @return
     */
    @PostMapping("/upd/recordpay")
    @ApiOperation("更新支付结果")
    public SmileResult updataRecordPay(@RequestBody ShootRecordSearchParament shootRecordSearchParament ){
       return clientAlbumService.updataRecordPay(shootRecordSearchParament);
    }





}
